﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo525_3
{
    class Computer
    {
        private string brand;
        private IUSB usb1;
        private IUSB usb2;

        public string Brand { get => brand; set => brand = value; }
        internal IUSB Usb1 { get => usb1; set => usb1 = value; }
        internal IUSB Usb2 { get => usb2; set => usb2 = value; }

        public Computer(string brand, IUSB usb1, IUSB usb2)
        {
            Brand = brand;
            Usb1 = usb1;
            Usb2 = usb2;
        }

        public void  Open() {
            Console.WriteLine("{0}电脑启动...",brand);
        }
        public void Read() {
            this.Usb1.Read();
            this.Usb2.Read();
        }
        public void Write() {
            this.Usb1.Write();
            this.Usb2.Write();
        }
        public void  Close() {
            Console.WriteLine("{0}电脑关闭...",brand);
        }
    }
}
